package com.whg.demo.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.util.Date;


/**
 * @Author whg
 * @create 2022/11/24 9:47
 * @description：
 */
@Data
public class User {

    @JsonProperty("account")
    private String name;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String phone;

    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss",locale = "zh",timezone = "GMT+8")
    private Date createTime;

    private Integer age;

    @JsonIgnore
    private String password;

    public User(String name, String phone, Date createTime, Integer age, String password) {
        this.name = name;
        this.phone = phone;
        this.createTime = createTime;
        this.age = age;
        this.password = password;
    }

    public User(String name, Date createTime, Integer age, String password) {
        this.name = name;
        this.createTime = createTime;
        this.age = age;
        this.password = password;
    }
}
